﻿package {
	import flash.events.TimerEvent;
	
	public class Utils {
		
		import flash.utils.*;
		
		private var dbInterval: int = 0;
		private var dbMax: int = 0;
		var testTimer: Timer;
		
		private function OnTimer(event: TimerEvent) {
			dbInterval = dbInterval + 20;
			if (dbInterval >= dbMax) {
				testTimer.stop();
				testTimer.reset();
				testTimer = null;
				
			}
		}
	
		public function Sleep(dMilliseconds: int) {
			dbInterval = 0;
			dbMax = 0;
			testTimer = new Timer(20, 0);
			testTimer.addEventListener(TimerEvent.TIMER, OnTimer);
			testTimer.start();
		}
		
	}
	
}